<include file="Public/common" />
<block>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
    <style>
        th{text-align: center;}
        .form-group{margin-left:20px;}
    </style>
</block>
<block name="content">
    <div class="page-header"><h1>首页 &gt;财务结算> 供应商线路结算 > 结算明细</h1></div>
    <div class="container">
        <div class="row text-left">
            <div class="col-md-4">团号:{$group.group_num}</div>
            <div class="col-md-4">线路名称:{$group.line_name}</div>
            <div class="col-md-4">成团日期:
                <if condition="$group['group_time']">
                    {$group.group_time|date="Y-m-d",###}
                </if>
            </div>
        </div>
    </div>
    <br>
   <div class="container-fluid">
       <if condition="checkAuth('Operator/Finance/exportGroupCostDetail')">
           <a href="{:U('exportGroupCostDetail',array('id'=>I('id')))}" class="btn btn-primary btn-xs pull-right">导出</a>
       </if>
   </div>
    <table class="table table-striped table-bordered table-hover table-condensed text-center">
        <thead>
        <tr>
            <th class="filtrate_1" >供应商 <!--<input type="checkbox" class="checkAll">--></th>
            <th class="filtrate_2" >团号</th>
            <th class="filtrate_3" >项目</th>
            <th class="filtrate_4" >数量</th>
            <th class="filtrate_5" >结算金额</th>
            <th class="filtrate_6" >币种</th>
            <th class="filtrate_8" >汇率</th>
            <th class="filtrate_6" >实付人民币</th>
            <th class="filtrate_6" >成团日期</th>
            <th class="filtrate_6" >结算状态</th>
            <th class="filtrate_6" >结算时间</th>
            <th class="filtrate_6" >操作人</th>
            <th class="filtrate_7" >操作</th>
        </tr>
        </thead>
        <tbody>
            <volist name="list" id="vo">
                <tr >
                   <td>{$vo.supplier_name}</td>
                   <td>{$vo.group_num}</td>
                   <td>{$vo.cost_type_name}</td>
                   <td>{$vo.num}</td>
                   <td>{$vo.cost_total_money}</td>
                   <td>{$vo.money_type}</td>
                   <td>{$vo.exchange_rate}</td>
                   <td>{$vo.actually_money}</td>
                   <td>{$vo.group_time}</td>
                   <td>{$vo.closing_status_name}</td>
                   <td>{$vo.closing_time}</td>
                   <td>{$vo.closing_operator}</td>
                   <td>
                       <if condition="checkAuth('Operator/Finance/closingStatus')">
                           <switch name="vo.closing_status">
                               <case value="-1"> <button class="btn btn-warning btn-xs" onclick="closing({$vo.id})">确认结算</button> </case>
                               <case value="1"> <button class="btn btn-warning btn-xs" onclick="closing({$vo.id})">确认结算</button> </case>
                           </switch>
                       </if>
                   </td>
                </tr>
            </volist>
        </tbody>
    </table>
</block>
<block name="js">
    <script src=""></script>
    <script src="__STATIC__/layui/layui.all.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script>
        /**
         * 打开订单详情页面
         * @param  {[int]}    orderId     [订单id]
         */

        //筛选显示
        $('body').on('change','.filtrate',function () {
            var id=$(this).val();
            if($(this).is(':checked')){
                $('.filtrate_'+id).show();
            }else{
                $('.filtrate_'+id).hide();
            }
        });


        layui.use('laydate', function() {
            var laydate = layui.laydate;
            //常规用法
            laydate.render({
                elem: '#start_time'
            });
            laydate.render({
                elem: '#end_time'
            });
        })

        /**
         * 成本结算页面
         * @param id
         */
        function closing(id){
            layer.open({
                type: 2,
                title: '确认结算',
                offset:80,
                closeBtn: 1, //不显示关闭按钮
                shade: [0],
                area: ['400px', '300px'],
                anim: 2,
                content: "/index.php?m=Operator&c=Finance&a=closingStatus&id="+id,
                end: function(){
                   location.reload();
                }
            });
        }

    </script>
</block>
